package 设计模式.创建者模式.原型模式;

//奖状类
public class Citation_1 implements Cloneable {
    private String name;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return (this.name);
    }

    public void show() {
        System.out.println(name + "同学：在2020学年第一学期中表现优秀，被评为三好学生。特发此状！");
    }

    @Override
    public Citation_1 clone() throws CloneNotSupportedException {
        return (Citation_1) super.clone();
    }
}

//测试访问类
class CitationTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        Citation_1 c1 = new Citation_1();
        c1.setName("张三");

        //复制奖状
        Citation_1 c2 = c1.clone();
        //将奖状的名字修改李四
        c2.setName("李四");

        c1.show();
        c2.show();
    }
}
